package com.visualize.demo.model;

import lombok.Getter;
import lombok.Setter;

import java.util.Date;

public class ThreeEmotionPercent {

    public ThreeEmotionPercent(Integer good, Integer bad, Integer medium, Date time) {
        float sum = good + bad + medium;
        if (sum == 0) {
            this.good = 0;
            this.bad = 0;
            this.medium = 0;
        } else {
            this.good = good / sum;
            this.bad = bad / sum;
            this.medium = medium / sum;
        }
        this.time = time;
    }

    @Getter
    @Setter
    private float good;
    @Getter
    @Setter
    private float bad;
    @Getter
    @Setter
    private float medium;
    @Getter
    @Setter
    private Date time;
}
